<!--
 * @Author: Bobby
 * @Date: 2021-12-30 10:01:42
 * @LastEditTime: 2022-02-15 14:24:57
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\index.vue
 * CIMC-V2
-->

<template>
  <div class="w-full h-full ve-body overflow-hidden">
    <!-- 工具栏 -->
    <ToolbarPane />
    <!-- 左面板 -->
    <LeftPane />
    <!-- 桌面 -->
    <Container />
    <!-- 参数 -->
    <ParamsPane />
    <!-- 所有弹框 -->
    <Modals />
    <!-- 预览页面 -->
    <PreviewModal v-if="getHasPreview" />
  </div>
</template>
<script>
  import { defineComponent } from 'vue'
  import ToolbarPane from './layout/toolbarPane'
  import Modals from './layout/modals'
  import LeftPane from './layout/leftPane'
  import Container from './layout/container'
  import ParamsPane from './layout/paramsPane'
  import PreviewModal from './layout/preview/previewModal'
  export default defineComponent({
    name: 'VisualEditor',
    components: {
      ToolbarPane,
      Modals,
      LeftPane,
      Container,
      ParamsPane,
      PreviewModal,
    },
    data() {
      return {}
    },
    computed: {
      getHasPreview() {
        return this.$store.getters['preview/getHasPreview']
      },
    },
    created() {
      document.body.ondrop = function (event) {
        event.preventDefault()
        event.stopPropagation()
      }
      if (this.$route.query.type && this.$route.query.type == 'mobile') {
        this.$store.dispatch('diy/setSettingsObject', {
          mode: 'mobile',
        })
      } else if (this.$route.query.type && this.$route.query.type == 'dataCharts') {
        this.$store.dispatch('diy/setSettingsObject', {
          mode: 'dataCharts',
        })
      }
    },
    methods: {
      log(event) {
        console.log(event)
      },
    },
  })
</script>
<style lang="scss">
  @import './styles/ve.scss';
</style>
